home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / dat_tim.com / DAT_TIM5.DOC < prev    next >
Encoding:
Text File  |  1989-09-10  |  2.6 KB  |  77 lines

  1. (*
  2.                        DAT_TIM5.DOC
  3.                      September 10, 1989
  4.  
  5.        A Turbo Pascal Unit (TPU) for Turbo Pascal 5.0
  6.           (Updated from the 11/11/88 TP 4.0 version)
  7.  
  8.                        Denam Systems
  9.              1115 Madison St. N.E.  Suite 226
  10.                    Salem, Oregon  97303
  11.  
  12.                       (503) 363-0198
  13.                   CompuServe 70405, 1422
  14.  
  15.                 Programmer: Dennis R. Fischer
  16.  
  17.                Copyright 1988-89, Denam Systems
  18.              FREEWARE - For noncommercial use only
  19.  
  20.  
  21.  
  22.    { Returns system time/date - NO expected input. System
  23.      date/time MUST be set correctly prior to using }
  24.    procedure GetDateStr     (var DateStr : string);    { 10/28/88 }
  25.    procedure GetDate4Str    (var DateStr : string);    { 10/28/1988 }
  26.    procedure GetFullDateStr (var DateStr : string);    { October 28, 1988 }
  27.    procedure GetTimeStr     (var TimeStr : string);    { 1:12 AM }
  28.    procedure GetTime24Str   (var Time24Str : string);  { 0112 }
  29.  
  30.  
  31.    { Date string expects either xx/xx/xx or xx/xx/xxxx format. }
  32.    function  ExtractMonth   (Date : string) : word;
  33.    function  ExtractDay     (Date : string) : word;
  34.    function  ExtractYear    (Date : string) : word;
  35.  
  36.  
  37.    { Time string MUST be 24 hour format }
  38.    function  ExtractHour    (Time : string) : word;
  39.    function  ExtractMinute  (Time : string) : word;
  40.  
  41.  
  42.    procedure ConvAMPMTo24   (var Time : string);
  43.    { Converts AM/PM time string to 24 hour string }
  44.  
  45.  
  46.    procedure Conv24ToAMPM   (var Time : string);
  47.    { Converts 24 hour string to AM/PM string }
  48.  
  49.  
  50.    function  IsLeap         (Year : word) : boolean;
  51.    { Returns TRUE if year is Leap Year }
  52.  
  53.  
  54.    function  DaysSince0     (Date : string) : longint;
  55.    { Returns the total number of days since January 1, 0000 AD
  56.      Expected input is xx/xx/xxxx  Minimum beginning date
  57.      is January 1, 0001 }
  58.  
  59.  
  60.    function  GetElaspeTime  (var TimeStr : string; var TimeVal : longint;
  61.                              SDate, EDate, STime, ETime : string) : boolean;
  62.  
  63.    {   Expects a date format of xx/xx/xxxx - If a date format of
  64.        xx/xx/xx is used, date will default to the 20th century (xx/xx/19xx)
  65.  
  66.        SDate = Starting date
  67.        EDate = Ending date
  68.        STime = Starting time (24 hour format)
  69.        ETime = Ending time (24 hour format)
  70.  
  71.        TimeStr returned = i.e. 2:36 (2 hours & 36 minutes)
  72.        TimeVal returned = total minutes
  73.  
  74.        Function returns TRUE if valid date & times were entered else
  75.        function returns FALSE and TimeStr contains error message }
  76.  
  77. *)